package com.txx.myspringboot.ioc.ann;

import com.txx.myspringboot.ioc.Bean.Animal;
import com.txx.myspringboot.ioc.Bean.Dog;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * 2.使用 @Configuration
 *        @Bean  注入
 */
@Configuration
public class BeanConfiguration {

    @Bean("dog")
    public Animal getDog(){
        return new Dog();
    }
}
